<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var str="abcse"
        function fn(str,value){
            var flag=false
            if(str[str.length-1]==value){
                flag=true
            }
            return flag
        }
        console.log(fn(str,"e"))

    </script>
</body>
</html>